#include "Helpers.h"

namespace uav
{
namespace math
{

namespace
{
	const Fixed HELPERS_60    = Fixed(60.0);
	const Fixed HELPERS_180   = Fixed(180.0);
	const Fixed HELPERS_10800 = Fixed(10800.0);
}

Fixed degreesToRadians(const Fixed &deg)
{
	return (deg * Fixed::Pi) / HELPERS_180;
}

Fixed minutesToRadians(const Fixed &min)
{
	return (min * Fixed::Pi) / HELPERS_10800;
}

Fixed degreesMinutesToRadians(int deg, const Fixed &min)
{
	return ((Fixed(deg * 60) + min) * Fixed::Pi) / HELPERS_10800;
}

Fixed radiansToDegrees(const Fixed &rad)
{
	return (rad * HELPERS_180) / Fixed::Pi;
}

}} // end namespace
